﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DatabaseExtension.Enums.Sql
{
    /// <summary>
    /// Value that indicates how the connection maintains its association with an enlisted.
    /// <seealso cref="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnectionstringbuilder.transactionbinding%28v=vs.100%29.aspx"/>
    /// </summary>
    public enum SqlTransactionBinding
    {
        /// <summary>
        /// Supply no transction bindings.
        /// </summary>
        None,
        /// <summary>
        /// The default. Causes the connection to detach from the transaction when it ends. 
        /// After detaching, additional requests on the connection are performed in autocommit mode. 
        /// The Current property is not checked when executing requests while the transaction is active. 
        /// After the transaction has ended, additional requests are performed in autocommit mode. 
        /// </summary>
        Implicit_Unbind,
        /// <summary>
        /// Causes the connection to remain attached to the transaction until the connection is closed or 
        /// until EnlistTransaction is called with a null (Nothing in Visual Basic) value. 
        /// An InvalidOperationException is thrown if Current is not the enlisted transaction or if 
        /// the enlisted transaction is not active. This behavior enforces the strict scoping rules 
        /// required for TransactionScope support.
        /// </summary>
        Explicit_Unbind
    }
    /// <summary>
    /// Expecting Type conversion.
    /// <seealso cref="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnectionstringbuilder.typesystemversion%28v=vs.100%29.aspx"/>
    /// </summary>
    public enum SqlTypeSystemVersion
    {
        /// <summary>
        /// No Type Conversions are set
        /// </summary>
        None,
        /// <summary>
        /// Uses the SQL Server 2000 type system. The following comparisons will be performed 
        /// when connecting to a SQL Server 2005 instance:
        /// XML to NTEXT
        /// UDT to VARBINARY
        /// VARCHAR(MAX), NVARCHAR(MAX) and VARBINARY(MAX) to TEXT, NEXT and IMAGE respectively.
        /// </summary>
        SQL_Server_2000,
        /// <summary>
        /// Uses the SQL Server 2005 type system. No conversions are made for the current version of ADO.NET.
        /// </summary>
        SQL_Server_2005,
        /// <summary>
        /// Uses the SQL Server 2008 type system.
        /// </summary>
        SQL_Server_2008,
        /// <summary>
        /// Use the latest version than this client-server pair can handle. 
        /// This will automatically move forward as the client and server components are upgraded.
        /// </summary>
        Latest
    }
    /// <summary>
    /// Use SqlCe Connection String Booleans as Flags
    /// </summary>
    [Flags]
    public enum SqlFlags
    {
        /// <summary>
        /// if only None selected, all boolean settings will be set to false. Not recomended.
        /// </summary>
        None = 0,
        /// <summary>
        /// Gets or sets a Boolean value that indicates whether asynchronous processing 
        /// is allowed by the connection created by using this connection string.
        /// </summary>
        AsynchronousProcessing = 1 << 0,
        /// <summary>
        /// Gets or sets a value that indicates whether a client/server or in-process connection 
        /// to SQL Server should be made.
        /// </summary>
        ContextConnection = 1 << 1,
        /// <summary>
        /// Gets or sets a Boolean value that indicates whether SQL Server uses SSL encryption for 
        /// all data sent between the client and server if the server has a certificate installed.
        /// </summary>
        Encrypt = 1 << 2,
        /// <summary>
        /// Gets or sets a Boolean value that indicates whether the SQL Server connection
        /// pooler automatically enlists the connection in the creation thread's current transaction context.
        /// </summary>
        Enlist = 1 << 3,
        /// <summary>
        /// Gets or sets a Boolean value that indicates whether User ID and Password are 
        /// specified in the connection (when false) or whether the current Windows account 
        /// credentials are used for authentication (when true).
        /// </summary>
        IntegratedSecurity = 1 << 4,
        /// <summary>
        /// Gets or sets a Boolean value that indicates whether multiple 
        /// active result sets can be associated with the associated connection.
        /// </summary>
        MultipleActiveResultSets = 1 << 5,
        /// <summary>
        /// Gets or sets a Boolean value that indicates if security-sensitive 
        /// information, such as the password, is not returned as part of the 
        /// connection if the connection is open or has ever been in an open state.
        /// </summary>
        PersistSecurityInfo = 1 << 6,
        /// <summary>
        /// Gets or sets a Boolean value that indicates whether the connection 
        /// will be pooled or explicitly opened every time that the connection is requested.
        /// </summary>
        Pooling =  1 << 7,
        /// <summary>
        /// Gets or sets a Boolean value that indicates whether 
        /// replication is supported using the connection.
        /// </summary>
        Replication = 1 << 8,
        /// <summary>
        /// Gets or sets a value that indicates whether the channel will be 
        /// encrypted while bypassing walking the certificate chain to validate trust.
        /// </summary>
        TrustServerCertificate = 1 << 9,
        /// <summary>
        /// Gets or sets a value that indicates whether to redirect the connection 
        /// from the default SQL Server Express instance to a runtime-initiated 
        /// instance running under the account of the caller.
        /// </summary>
        /// <remarks>
        /// This feature is available only with the SQL Server 2005 Express Edition. 
        /// For more information on user instances, see Connecting to SQL Server Express User 
        /// Instances (ADO.NET) and "User Instances for Non-Administrators" in SQL Server Books Online.
        /// </remarks>
        UserInstance = 1 << 10
    }
}
